// This file automatically gets called first by SocketStream and must always exist

// Make 'ss' available to all modules and the browser console
window.ss = require('socketstream');

ss.server.on('disconnect', function(){
  console.log('Connection down :-(');
});

ss.server.on('reconnect', function(){
  console.log('Connection back up :-)');
});

ss.server.on('ready', function(){

  // Wait for the DOM to finish loading
  jQuery(function(){  
    // Load app
    /*
    require('/chat');
    $.chat('123').appendTo('body')
    $.chat('123').appendTo('body')
    $.chat('12').appendTo('body')
    */
    require('/personal');
    $.personal('1').appendTo('body')
    $.personal('2').appendTo('body')
    $.personal('123').appendTo('body')
    $.personal('123').appendTo('body')
    require('/job');
    $.job('11').appendTo('body')
    $.job('13').appendTo('body')
    $.job('13').appendTo('body')
  });

});
